useR 2019 - Toulouse - 2019/07/09
sp & rgeos
ggplot2 (Wickham, 2016) + ggspatial (Dunnington, 2018)sf objects.tmap (Tennekes, 2018)ggplot2)library(sf)
library(cartography)
# path to the geo file embedded in cartography
path <- system.file("gpkg/mtq.gpkg",
package = "cartography")
# import to an sf object
mtq <- st_read(dsn = path, quiet = TRUE)
# Set figure margins
par(mar = c(0,0,1.2,0), bg = "#b5d0d0")
# Plot the choropleth map
choroLayer(
x = mtq, var = "MED",
method = "equal", nclass = 4,
col = carto.pal(pal1 = "sand.pal", n1 = 4),
legend.values.rnd = -2, legend.pos = "left",
legend.title.txt = "Median Income\n(in euros)"
)
# Plot a layout
layoutLayer(
title="Wealth in Martinique, 2015",
author = "T. Giraud, 2019",
sources = "Sources: Insee and IGN - 2018",
scale = 5, north = TRUE,
tabtitle = TRUE, frame = FALSE
)
osrm: Get road distances (time) between each municipalities.
SpatialPosition: Compute gravitationnal accessibility based on road distances.
cartography::getBreaks(): Classify data
cartography::carto.pal(): Use color palettes from the package
cartography::choroLayer(): Plot the choropleth map
cartography::getFigDim(): Find the correct ratio for png export.sf: a lot geodata transformations
cartography::propSymolsLayer(): Display the proportionnal symbols
cartography::layoutLayer(): Display the map layoutcartography::getPencilLayer(): Transform polygons to hand-drawn polylines
cartography::choroLayer(): Display a choropleth map
spatstats: Compute KDE
tanaka: Display the shaded contour lines
cartography::LegendChoro(): Plot the Legend
cartography::layoutLayer(): Plot the map layout
cartography::choroLayer(): Plot a choropleth map
cartography::getBorders(): Extract borders between countries
cartography::discLayer(): Map the discontinuities on borders
cartography::layoutLayer(): Map layout
github.com/riatelab/cartography
@rgeomatic
rgeomatic.hypotheses.org